/**************************************************************************************************/
/*                                    NEW FORM                                                    */
/**************************************************************************************************/

<<<<<<< .mine
var
	Header = "<html><head><title>Moderation</title>"
	Footer = "</body></html>"
	CSS = {"<style type = "text/css">
body{background: #000; color: #CCC;}
.moderation{background: #1133FF; border: 2px groove #1133FF; width: 400px; padding: 0px; position: absolute; left: 0px; top: 0px}
.moderation td, .moderation th{background: #000; border: 2px groove #66AADD; width: 50%;}
.select select{width: 100%;}
textarea{width: 100%;}
</style></head><body>"}
	Javastart = {"<script style="javascript">
		function Moderate() {
			if(document.moderate.chatters.selectedIndex!=-1) {
				var user = document.moderate.chatters\[document.moderate.chatters.selectedIndex].text;
			}
			else {
				var user = "null";
			}"}
=======
client
	Admin
		verb {
			Admin_Form() {
				set
					hidden = 1
					name = "Admin"
				var
					Full_Page
					Header = {"<html>
	<head>
		<title>Moderation</title>
		"}


					Javascript = {"
					<script style="javascript">
						function Moderate() {
							if(document.moderate.chatters.selectedIndex!=-1) {
								var user = document.moderate.chatters\[document.moderate.chatters.selectedIndex].text;
							}
							else {
								var user = "null";
							}

							if(document.moderate.punishment.selectedIndex!=-1) {
								var punishment = document.moderate.punishment\[document.moderate.punishment.selectedIndex].text;
							}
							else {
								var punishment = "null";
							}
							document.location = 'byond://?action=Moderate;user='+user+';punishment='+punishment;
						}
					</script>
					"}


					CSS = {"<style type = "text/css">
	body{background: #000; color: #CCC;}
	.moderation{background: #1133FF; border: 2px groove #1133FF; width: 400px; padding: 0px; position: absolute; left: 0px; top: 0px}
	.moderation td, .moderation th{background: #000; border: 2px groove #66AADD; width: 50%;}
	.select select{width: 100%;}
</style>"}


					Page = {"
		</head>
	<body>
		<form name="moderate" method="get">
		<table class="moderation">
			<tr><th colspan="2">Moderation</th></tr>
			<tr><td class="select">
				<select name="chatters" size="10" multiple="multiple">"}
				for(var/client/Target) Page+="<option>[Target.key]</option>"
				Page+={"</select></td>
				<td class="select">
					<select name="punishment" size="10" multule="multiple">
						<option>Mute</option>
						<option>Unmute</option>
						<option>Ban</option>
						<option>Unban</option>
						<option>Kick</option>
					</select>
				</td>
					</tr>
>>>>>>> .r56
				<tr>
					<td colspan="2">
					<input type="button" value="Submit" onclick="Moderate(this.form)" />
					</td>
				</tr>
<<<<<<< .mine
=======
		</table>
		</form>
	</body>
</html>"}
				Full_Page = "[Header][Javascript][CSS][Page]"
				src<<browse(Full_Page,"window=moderation;size=400x400;can_resize=0")
			}
		}
>>>>>>> .r56

<<<<<<< .mine
client/proc
	AdminForm()
		var/Javascript = {"
			<script style="javascript">
				function SetTopic() {
						var topic = document.moderate.topic.value;
						document.location = 'byond://?action=Topic;topic='+topic;
					}
			</script>
			"}
		var/Page = {"
					<form name="moderate" method="get">
					<table class="moderation">
					<tr><th colspan="2">Moderation Forms</th></tr>
					<tr><th><a href="byond://?action=AdminPage;page=Mute;">Mute</a></th><th><a href="byond://?action=AdminPage;page=Unmute;">Unmute</a></th></tr>
					<tr><th><a href="byond://?action=AdminPage;page=Ban;">Ban</a></th><th><a href="byond://?action=AdminPage;page=Unban;">Unban</a></th></tr>
					<tr><th><a href="byond://?action=AdminPage;page=Kick;">Kick</a></th><th>View the Charts</th></tr>
					<tr><th colspan="2">Current Topic</th></tr>
					<tr><td colspan="2"><textarea name="topic">[ConversationTopic]</textarea></td></tr>
					<tr><th colspan="2"><input type="button" value="Set Topic" onclick="SetTopic(this.form)" /></th></tr>
					</table>
					</form>
				"}
		var/Full_Page = "[Header][Javascript][CSS][Page][Footer]"
		src<<browse(Full_Page,"window=moderation;size=400x400;can_resize=0")
=======
client/proc
	Administrate(action, user)
		if(action == "mute")
			world<<"mute [user]"
		else if(action == "kick")
			world<<"kick [user]"
		else if(action == "ban")
			world<<"ban [user]"
		else if(action == "unmute")
			world<<"unmute [user]"
		else if(action == "unban")
			world<<"unban [user]"

client/Topic(href,href_list[])
	world<<"weee1"
	switch(href_list["action"])
		if("Moderate")
			world<<"weee2"

/**************************************************************************************************/
/*                                    Admin Stuff                                                 */
/**************************************************************************************************/
>>>>>>> .r56


	MuteForm()
		var/Javascript = "document.location = 'byond://?action=Moderate;user='+user+';punishment=Mute';}</script>"
		var/Page = {"
					<form name="moderate" method="get">
					<table class="moderation">
						<tr><th colspan="2">Mute</th></tr>
						<tr><td class="select" colspan="2">
						<select name="chatters" size="10" multiple="multiple">"}
		for(var/client/Target)
			Page+="<option>[Target.key]</option>"
		Page+={"</select></td></tr>
						<tr><td colspan="2"><input type="button" value="Submit" onclick="Moderate(this.form)" /></td></tr>
					</table>
					</form>"}
		var/Full_Page = "[Header][Javastart][Javascript][CSS][Page][Footer]"
		src<<browse(Full_Page,"window=moderation;size=400x400;can_resize=0")

	BanForm()
		var/Javascript = "document.location = 'byond://?action=Moderate;user='+user+';punishment=Ban';}</script>"
		var/Page = {"
					<form name="moderate" method="get">
					<table class="moderation">
						<tr><th colspan="2">Ban</th></tr>
						<tr><td class="select" colspan="2">
						<select name="chatters" size="10" multiple="multiple">"}
		for(var/client/Target)
			Page+="<option>[Target.key]</option>"
		Page+={"</select></td></tr>
						<tr><td colspan="2"><input type="button" value="Submit" onclick="Moderate(this.form)" /></td></tr>
					</table>
					</form>"}
		var/Full_Page = "[Header][Javastart][Javascript][CSS][Page][Footer]"
		src<<browse(Full_Page,"window=moderation;size=400x400;can_resize=0")

	KickForm()
		var/Javascript = "document.location = 'byond://?action=Moderate;user='+user+';punishment=Kick';}</script>"
		var/Page = {"
					<form name="moderate" method="get">
					<table class="moderation">
						<tr><th colspan="2">Kick</th></tr>
						<tr><td class="select" colspan="2">
						<select name="chatters" size="10" multiple="multiple">"}
		for(var/client/Target)
			Page+="<option>[Target.key]</option>"
		Page+={"</select></td></tr>
						<tr><td colspan="2"><input type="button" value="Submit" onclick="Moderate(this.form)" /></td></tr>
					</table>
					</form>"}
		var/Full_Page = "[Header][Javastart][Javascript][CSS][Page][Footer]"
		src<<browse(Full_Page,"window=moderation;size=400x400;can_resize=0")

	UnmuteForm()
		var/Javascript = "document.location = 'byond://?action=Moderate;user='+user+';punishment=Unmute';}</script>"
		var/Page = {"
					<form name="moderate" method="get">
					<table class="moderation">
						<tr><th colspan="2">Unmute</th></tr>
						<tr><td class="select" colspan="2">
						<select name="chatters" size="10" multiple="multiple">"}
		for(var/Target in MuteList)
			Page+="<option>[Target]</option>"
		Page+={"</select></td></tr>
						<tr><td colspan="2"><input type="button" value="Submit" onclick="Moderate(this.form)" /></td></tr>
					</table>
					</form>"}
		var/Full_Page = "[Header][Javastart][Javascript][CSS][Page][Footer]"
		src<<browse(Full_Page,"window=moderation;size=400x400;can_resize=0")

	UnbanForm()
		var/Javascript = "document.location = 'byond://?action=Moderate;user='+user+';punishment=Unban';}</script>"
		var/Page = {"
					<form name="moderate" method="get">
					<table class="moderation">
						<tr><th colspan="2">Unban</th></tr>
						<tr><td class="select" colspan="2">
						<select name="chatters" size="10" multiple="multiple">"}
		for(var/Target in Banned)
			Page+="<option>[Target]</option>"
		Page+={"</select></td></tr>
						<tr><td colspan="2"><input type="button" value="Submit" onclick="Moderate(this.form)" /></td></tr>
					</table>
					</form>"}
		var/Full_Page = "[Header][Javastart][Javascript][CSS][Page][Footer]"
		src<<browse(Full_Page,"window=moderation;size=400x400;can_resize=0")


client/proc
	Administrate(action, user)
		if(action == "Mute")
			if(user in MuteList)
				System_UserMessage(src,"[user] is already muted.")
			else
				System_WorldMessage("[user] has been muted.")
				MuteList+=user

		else if(action == "Kick")
			for(var/client/C)
				if(C.key == user)
					System_WorldMessage("[user] has been kicked.")
					del(C)
					return 0
			System_UserMessage(src,"We couldn't find anyone named [user].")

		else if(action == "Ban")
			if(user in Banned)
				System_UserMessage(src,"[user] is already banned.")
			else
				System_WorldMessage("[user] has been banned.")
				Banned+=user
				for(var/client/C)
					if(C.key == user)
						del(C)

		else if(action == "Unmute")
			if(user in MuteList)
				System_WorldMessage("[user] is no longer muted.")
				MuteList-=user
			else
				System_UserMessage(src,"[user] is not muted.")


		else if(action == "Unban")
			if(user in Banned)
				System_WorldMessage("[user] is no longer banned.")
				Banned-=user
			else
				System_UserMessage(src,"[user] is not banned.")

client/Topic(href,href_list[])
	..()
	switch(href_list["action"])
		if("Moderate")
			if(href_list["user"]=="null"||href_list["punishment"]=="null")
				return
			else
				Administrate(href_list["punishment"],href_list["user"])
				AdminForm()
		if("Topic")
			if(href_list["topic"]!=ConversationTopic)
				ConversationTopic = href_list["topic"]
				for(var/client/M) {winset(M,"Main.Topic","text=\"[ConversationTopic]\"")}
				System_WorldMessage("[src] has changed the topic.")
		if("AdminPage")
			if(href_list["page"]=="Mute")
				MuteForm()
			if(href_list["page"]=="Ban")
				BanForm()
			if(href_list["page"]=="Kick")
				KickForm()
			if(href_list["page"]=="Unmute")
				UnmuteForm()
			if(href_list["page"]=="Unban")
				UnbanForm()


client/Admin/verb/Admin() AdminForm()